import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FrontComponent } from './front.component';
import {RouterModule, Routes} from '@angular/router';
import { StructComponent } from './struct/struct.component';
import { StyleComponent } from './style/style.component';
import { ScriptComponent } from './script/script.component';
import { JsComponent } from './script/js/js.component';
import { TsComponent } from './script/ts/ts.component';
import { StylesComponent } from './style/styles/styles.component';

const frontRoutes: Routes = [
  {path: '', component: FrontComponent, children: [
      {path: 'struct', component: StructComponent},
      {path: 'style', component: StyleComponent, children: [
          {path: 'styles', component: StylesComponent},
          {path: 'styles/:id', component: StylesComponent}
        ]},
      {path: 'script', component: ScriptComponent, children: [
        {path: 'ecma', component: JsComponent, outlet: 'js'},
        {path: 'ecma', component: TsComponent, outlet: 'ts'}
      ]}
    ]}
];
@NgModule({
  imports: [
    CommonModule,
    RouterModule.forChild(frontRoutes)
  ],
  declarations: [FrontComponent, StructComponent, StyleComponent, ScriptComponent, JsComponent, TsComponent, StylesComponent]
})
export class FrontModule { }
